<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../js/vue.js"></script>
  <style>
    .active{
        color: red;
    }
  </style>
</head>
<body>
  <div id="app">
      <li :class="{active:chooseIndex === key}" v-for="(item,key) in books" :key="book" @click=""btnClick(key)>{{books}}+{{key}}</li>
  </div>
<br>
  <script>
    let app = new Vue({
      el:"#app",
      data:{
           msg:'hello world',
           books:["某某","撒野","放学等我","于我"],
           currentIndex:''
       },
       methods:{
        btnClick(key){
            this.chooseIndex=key
        }
       },
     })
   </script>
</body>
</html>